package com.kye.express.utils;

import android.content.ClipboardManager;
import android.content.Context;

/**
 * @author : Joe
 * @version : 1.0
 * @editor : Joe
 * @created : 07/02/2018
 * @updated : 07/02/2018
 * @description : <Description>
 * @update_reason : <UpdateReason>
 */

public class ClipboardUtils {
    /**
     * 实现文本复制功能
     * add by wangqianzhou
     *
     * @param content
     */
    public static void copy(String content, Context context) {
        ClipboardManager cmb = (ClipboardManager) context.getSystemService(Context.CLIPBOARD_SERVICE);
        cmb.setText(content.trim());
    }

    /**
     * 实现粘贴功能
     * add by wangqianzhou
     *
     * @param context
     * @return
     */
    public static String paste(Context context) {
        ClipboardManager cmb = (ClipboardManager) context.getSystemService(Context.CLIPBOARD_SERVICE);
        return cmb.getText().toString().trim();
    }
}
